/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package entityprojet;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Ron
 */
@Entity
@Table(name = "F_DEPOTEMPL")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "FDepotempl.findAll", query = "SELECT f FROM FDepotempl f"),
    @NamedQuery(name = "FDepotempl.findByDPNo", query = "SELECT f FROM FDepotempl f WHERE f.dPNo = :dPNo"),
    @NamedQuery(name = "FDepotempl.findByDPCode", query = "SELECT f FROM FDepotempl f WHERE f.dPCode = :dPCode"),
    @NamedQuery(name = "FDepotempl.findByDPIntitule", query = "SELECT f FROM FDepotempl f WHERE f.dPIntitule = :dPIntitule"),
    @NamedQuery(name = "FDepotempl.findByDPZone", query = "SELECT f FROM FDepotempl f WHERE f.dPZone = :dPZone"),
    @NamedQuery(name = "FDepotempl.findByDPType", query = "SELECT f FROM FDepotempl f WHERE f.dPType = :dPType"),
    @NamedQuery(name = "FDepotempl.findByCbProt", query = "SELECT f FROM FDepotempl f WHERE f.cbProt = :cbProt"),
    @NamedQuery(name = "FDepotempl.findByCbMarq", query = "SELECT f FROM FDepotempl f WHERE f.cbMarq = :cbMarq"),
    @NamedQuery(name = "FDepotempl.findByCbCreateur", query = "SELECT f FROM FDepotempl f WHERE f.cbCreateur = :cbCreateur"),
    @NamedQuery(name = "FDepotempl.findByCbModification", query = "SELECT f FROM FDepotempl f WHERE f.cbModification = :cbModification"),
    @NamedQuery(name = "FDepotempl.findByCbReplication", query = "SELECT f FROM FDepotempl f WHERE f.cbReplication = :cbReplication"),
    @NamedQuery(name = "FDepotempl.findByCbFlag", query = "SELECT f FROM FDepotempl f WHERE f.cbFlag = :cbFlag")})
public class FDepotempl implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "DP_No")
    private Integer dPNo;
    @Column(name = "DP_Code")
    private String dPCode;
    @Lob
    @Column(name = "cbDP_Code")
    private byte[] cbDPCode;
    @Column(name = "DP_Intitule")
    private String dPIntitule;
    @Column(name = "DP_Zone")
    private Short dPZone;
    @Column(name = "DP_Type")
    private Short dPType;
    @Column(name = "cbProt")
    private Short cbProt;
    @Id
    @Basic(optional = false)
    @Column(name = "cbMarq")
    private Integer cbMarq;
    @Column(name = "cbCreateur")
    private String cbCreateur;
    @Column(name = "cbModification")
    @Temporal(TemporalType.TIMESTAMP)
    private Date cbModification;
    @Column(name = "cbReplication")
    private Integer cbReplication;
    @Column(name = "cbFlag")
    private Short cbFlag;
    @OneToMany(mappedBy = "cbDPNoDefaut")
    private Collection<FDepot> fDepotCollection;
    @JoinColumn(name = "DE_No", referencedColumnName = "DE_No")
    @ManyToOne(optional = false)
    private FDepot dENo;

    public FDepotempl() {
    }

    public FDepotempl(Integer cbMarq) {
        this.cbMarq = cbMarq;
    }

    public Integer getDPNo() {
        return dPNo;
    }

    public void setDPNo(Integer dPNo) {
        this.dPNo = dPNo;
    }

    public String getDPCode() {
        return dPCode;
    }

    public void setDPCode(String dPCode) {
        this.dPCode = dPCode;
    }

    public byte[] getCbDPCode() {
        return cbDPCode;
    }

    public void setCbDPCode(byte[] cbDPCode) {
        this.cbDPCode = cbDPCode;
    }

    public String getDPIntitule() {
        return dPIntitule;
    }

    public void setDPIntitule(String dPIntitule) {
        this.dPIntitule = dPIntitule;
    }

    public Short getDPZone() {
        return dPZone;
    }

    public void setDPZone(Short dPZone) {
        this.dPZone = dPZone;
    }

    public Short getDPType() {
        return dPType;
    }

    public void setDPType(Short dPType) {
        this.dPType = dPType;
    }

    public Short getCbProt() {
        return cbProt;
    }

    public void setCbProt(Short cbProt) {
        this.cbProt = cbProt;
    }

    public Integer getCbMarq() {
        return cbMarq;
    }

    public void setCbMarq(Integer cbMarq) {
        this.cbMarq = cbMarq;
    }

    public String getCbCreateur() {
        return cbCreateur;
    }

    public void setCbCreateur(String cbCreateur) {
        this.cbCreateur = cbCreateur;
    }

    public Date getCbModification() {
        return cbModification;
    }

    public void setCbModification(Date cbModification) {
        this.cbModification = cbModification;
    }

    public Integer getCbReplication() {
        return cbReplication;
    }

    public void setCbReplication(Integer cbReplication) {
        this.cbReplication = cbReplication;
    }

    public Short getCbFlag() {
        return cbFlag;
    }

    public void setCbFlag(Short cbFlag) {
        this.cbFlag = cbFlag;
    }

    @XmlTransient
    public Collection<FDepot> getFDepotCollection() {
        return fDepotCollection;
    }

    public void setFDepotCollection(Collection<FDepot> fDepotCollection) {
        this.fDepotCollection = fDepotCollection;
    }

    public FDepot getDENo() {
        return dENo;
    }

    public void setDENo(FDepot dENo) {
        this.dENo = dENo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cbMarq != null ? cbMarq.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FDepotempl)) {
            return false;
        }
        FDepotempl other = (FDepotempl) object;
        if ((this.cbMarq == null && other.cbMarq != null) || (this.cbMarq != null && !this.cbMarq.equals(other.cbMarq))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityprojet.FDepotempl[ cbMarq=" + cbMarq + " ]";
    }
    
}
